/**
 * 
 */
package com.sci.web.action.datareportseason.enterprise_attachment;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import com.sci.web.action.util.BaseAction;
import com.sci.web.dao.DateReportM_Enterprise_AttachmentDao;

/**
 * @author  BaiFuyou
 * @date: Nov 8, 2011 3:12:53 PM
 */
public class DeleteEnterprise_AttachmentAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1561087377312453894L;
	@Resource
	private DateReportM_Enterprise_AttachmentDao dateReportM_Enterprise_AttachmentDao;
	private int id;
	private int eid;
	private String name;
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}
	/**
	 * @return the eid
	 */
	public int getEid() {
		return eid;
	}
	/**
	 * @param eid the eid to set
	 */
	public void setEid(int eid) {
		this.eid = eid;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("attachment_id", id);
		map.put("enterprise_id", eid);
		map.put("attachment_name", name);
		super.setContentType(super.JSON);
		if(dateReportM_Enterprise_AttachmentDao.deleteOneEnterprise_AttachmentById(map)){
			super.outPrint("ok");
		}else{
			super.outPrint("fail");
		}
		return "json";
	}

}
